using System;
using System.Reflection;
using System.Windows.Forms;

using Tino.Core;

namespace Tino
{
    public partial class AboutForm : Form
    {
        public AboutForm()
        {
            InitializeComponent();
            
            setAssemblyVersion();
            setFrameWorkVersion();
        }

        void setAssemblyVersion()
        {
            Assembly exeAssembly = Assembly.GetExecutingAssembly();
            Assembly coreAssembly = typeof(Context).Assembly;

            string exeVersion = string.Format("Exe build {0}", exeAssembly.GetName().Version.Revision);
            string coreVersion = string.Format("Core build {0}", coreAssembly.GetName().Version.Revision);

            versionLabel.Text = string.Format("Version {0} ({1}, {2})", Application.ProductVersion, exeVersion, coreVersion);
        }

        void setFrameWorkVersion()
        {
            string netVersion = Environment.Version.ToString();
            frameworkVersionLabel.Text = string.Format(".NET Version {0}", netVersion);
        }

        void okButton_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}